<template>
  <div class="mon-dialog">
    <el-dialog :visible.sync="visible">
      <div class="dia-container">
        <div>
          <div class="top-title flex flexac flexjcsb fs14 cfff p-l-20">
            <div class="title">{{ title }}</div>
            <i class="el-icon-close m-r-20" @click="handleCloseDialog" />
          </div>
        </div>
        <div class="dia-main">
          <div class="coSelect-dialog m-t-20 m-b-20">
            <div class="flex flexac m-l-15">
              <el-input v-model="name" class="co-input m-l-10" placeholder="请输入安装位置" @keyup.enter.native="getOrg" @input="handleSearch" />
              <el-button class="searchBtn co-btn flex flexac m-l-20 m-r-20" size="small" type="warning" @click="getOrg"><i class="co-i" /><span class="search1">查 询</span></el-button>
              <el-button class="defaultbtn co-btn saveBtn m-l-10 el-icon-success" @click="handleSelectSave">选 中</el-button>
            </div>
            <el-table
              ref="multipleTable"
              class="m-t-30 con-table m-b-25"
              type="expand"
              :data="dataList.slice((paging.currentPage - 1) * paging.pageSize, paging.currentPage * paging.pageSize)"
              highlight-current-row
              @select-all="handleCheck"
              @select="handleCheck"
              @selection-change="handleCheckChange"
              @row-dblclick="dbSelected"
            >
              <el-table-column type="selection" align="center" width="55" height="40" />
              <template v-for="item in tablehead">
                {{ item }}
                <el-table-column :key="item.index" align="center" :prop="item.prop" :label="item.label" />
              </template>
            </el-table>
          </div>
          <el-pagination
            class="paginationWrap co-page flex m-l-10"
            :current-page="paging.currentPage"
            :page-sizes="paging.pageSizeArr"
            :page-size="paging.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="paging.total"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import 
export default {
  name: 'Mondialog',
  props: {
    value: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
    }
  },
  watch: {
    visible(v) {
      this.$emit('input', v)
    },
    value(v) {
      this.visible = v
    }
  },
  methods: {
    handleCloseDialog() {
      this.visible = !this.visible
    }
  }
}
</script>
